<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
A simple homogeneous pair type with useful Functor, Applicative, and
Traversable instances.
-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Data.Pair</span><span>
</span><span id="line-10"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier">Pair</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-11"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#unPair"><span class="hs-identifier">unPair</span></a></span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#toPair"><span class="hs-identifier">toPair</span></a></span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#swap"><span class="hs-identifier">swap</span></a></span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#pLiftFst"><span class="hs-identifier">pLiftFst</span></a></span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#pLiftSnd"><span class="hs-identifier">pLiftSnd</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semi</span></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">data</span><span> </span><span id="Pair"><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span></span><span> </span><span id="local-6989586621680814629"><span class="annot"><a href="#local-6989586621680814629"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Pair"><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="pFst"><span class="annot"><span class="annottext">forall a. Pair a -&gt; a
</span><a href="GHC.Data.Pair.html#pFst"><span class="hs-identifier hs-var hs-var">pFst</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621680814629"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span id="pSnd"><span class="annot"><span class="annottext">forall a. Pair a -&gt; a
</span><a href="GHC.Data.Pair.html#pSnd"><span class="hs-identifier hs-var hs-var">pSnd</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621680814629"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-27"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680814486"><span id="local-6989586621680814488"><span class="annot"><span class="annottext">(forall a b. (a -&gt; b) -&gt; Pair a -&gt; Pair b)
-&gt; (forall a b. a -&gt; Pair b -&gt; Pair a) -&gt; Functor Pair
forall a b. a -&gt; Pair b -&gt; Pair a
forall a b. (a -&gt; b) -&gt; Pair a -&gt; Pair b
forall (f :: * -&gt; *).
(forall a b. (a -&gt; b) -&gt; f a -&gt; f b)
-&gt; (forall a b. a -&gt; f b -&gt; f a) -&gt; Functor f
&lt;$ :: forall a b. a -&gt; Pair b -&gt; Pair a
$c&lt;$ :: forall a b. a -&gt; Pair b -&gt; Pair a
fmap :: forall a b. (a -&gt; b) -&gt; Pair a -&gt; Pair b
$cfmap :: forall a b. (a -&gt; b) -&gt; Pair a -&gt; Pair b
</span><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Functor</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- Note that Pair is a *unary* type constructor</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- whereas (,) is binary</span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- The important thing about Pair is that it has a *homogeneous*</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- Functor instance, so you can easily apply the same function</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- to both components</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814474"><span id="local-6989586621680814476"><span id="local-6989586621680814478"><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-36"></span><span>  </span><span id="local-6989586621680814472"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; Pair a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621680814471"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814471"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814471"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814471"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-37"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814470"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621680814470"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680814469"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621680814469"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680814468"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. Pair (a -&gt; b) -&gt; Pair a -&gt; Pair b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814467"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814467"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680814466"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814466"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; Pair b
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621680814470"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814467"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621680814469"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814466"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814433"><span id="local-6989586621680814435"><span id="local-6989586621680814437"><span id="local-6989586621680814439"><span id="local-6989586621680814441"><span id="local-6989586621680814443"><span id="local-6989586621680814445"><span id="local-6989586621680814447"><span id="local-6989586621680814449"><span id="local-6989586621680814451"><span id="local-6989586621680814453"><span id="local-6989586621680814455"><span id="local-6989586621680814457"><span id="local-6989586621680814459"><span id="local-6989586621680814461"><span id="local-6989586621680814464"><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-40"></span><span>  </span><span id="local-6989586621680814429"><span class="annot"><span class="annottext">foldMap :: forall m a. Monoid m =&gt; (a -&gt; m) -&gt; Pair a -&gt; m
</span><a href="../../base/src/Data.Foldable.html#foldMap"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldMap</span></a></span></span><span> </span><span id="local-6989586621680814427"><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621680814427"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814426"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814426"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680814425"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814425"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621680814427"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814426"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m -&gt; m -&gt; m
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-operator hs-var">`mappend`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621680814427"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814425"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814414"><span id="local-6989586621680814416"><span id="local-6989586621680814418"><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-43"></span><span>  </span><span id="local-6989586621680814407"><span class="annot"><span class="annottext">traverse :: forall (f :: * -&gt; *) a b.
Applicative f =&gt;
(a -&gt; f b) -&gt; Pair a -&gt; f (Pair b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var hs-var hs-var hs-var">traverse</span></a></span></span><span> </span><span id="local-6989586621680814405"><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680814405"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814404"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814404"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680814403"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814403"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; b -&gt; Pair b
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="annot"><span class="annottext">(b -&gt; b -&gt; Pair b) -&gt; f b -&gt; f (b -&gt; Pair b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680814405"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814404"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">f (b -&gt; Pair b) -&gt; f b -&gt; f (Pair b)
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621680814405"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814403"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span id="local-6989586621680814569"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814397"><span id="local-6989586621680814399"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814569"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814569"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-46"></span><span>  </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814393"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814393"><span class="hs-identifier hs-var">a1</span></a></span></span><span> </span><span id="local-6989586621680814392"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814392"><span class="hs-identifier hs-var">b1</span></a></span></span><span> </span><span id="local-6989586621680814391"><span class="annot"><span class="annottext">&lt;&gt; :: Pair a -&gt; Pair a -&gt; Pair a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;&gt;</span></a></span></span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814390"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814390"><span class="hs-identifier hs-var">a2</span></a></span></span><span> </span><span id="local-6989586621680814389"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814389"><span class="hs-identifier hs-var">b2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814393"><span class="hs-identifier hs-var">a1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">Semi.&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814390"><span class="hs-identifier hs-var">a2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814392"><span class="hs-identifier hs-var">b1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">Semi.&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814389"><span class="hs-identifier hs-var">b2</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span id="local-6989586621680814568"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814383"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814568"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814568"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814568"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-49"></span><span>  </span><span id="local-6989586621680814379"><span class="annot"><span class="annottext">mempty :: Pair a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-50"></span><span>  </span><span id="local-6989586621680814377"><span class="annot"><span class="annottext">mappend :: Pair a -&gt; Pair a -&gt; Pair a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Pair a -&gt; Pair a -&gt; Pair a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semi.&lt;&gt;)</span></a></span></span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span id="local-6989586621680814565"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680814374"><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814565"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814565"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-53"></span><span>  </span><span id="local-6989586621680814370"><span class="annot"><span class="annottext">ppr :: Pair a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var hs-var hs-var hs-var">ppr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814368"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814368"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680814367"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814367"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814368"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'~'</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814367"><span class="hs-identifier hs-var">b</span></a></span></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span id="local-6989586621680814564"><span class="annot"><a href="GHC.Data.Pair.html#unPair"><span class="hs-identifier hs-type">unPair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814564"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680814564"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680814564"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-56"></span><span id="unPair"><span class="annot"><span class="annottext">unPair :: forall a. Pair a -&gt; (a, a)
</span><a href="GHC.Data.Pair.html#unPair"><span class="hs-identifier hs-var hs-var">unPair</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814364"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814364"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680814363"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814363"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814364"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814363"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span id="local-6989586621680814562"><span class="annot"><a href="GHC.Data.Pair.html#toPair"><span class="hs-identifier hs-type">toPair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680814562"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span class="annot"><a href="#local-6989586621680814562"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814562"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-59"></span><span id="toPair"><span class="annot"><span class="annottext">toPair :: forall a. (a, a) -&gt; Pair a
</span><a href="GHC.Data.Pair.html#toPair"><span class="hs-identifier hs-var hs-var">toPair</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680814362"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814362"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680814361"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814361"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814362"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814361"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span id="local-6989586621680814560"><span class="annot"><a href="GHC.Data.Pair.html#swap"><span class="hs-identifier hs-type">swap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814560"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814560"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-62"></span><span id="swap"><span class="annot"><span class="annottext">swap :: forall a. Pair a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#swap"><span class="hs-identifier hs-var hs-var">swap</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814360"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814360"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680814359"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814359"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814359"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814360"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span id="local-6989586621680814558"><span class="annot"><a href="GHC.Data.Pair.html#pLiftFst"><span class="hs-identifier hs-type">pLiftFst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680814558"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680814558"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814558"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814558"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-65"></span><span id="pLiftFst"><span class="annot"><span class="annottext">pLiftFst :: forall a. (a -&gt; a) -&gt; Pair a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#pLiftFst"><span class="hs-identifier hs-var hs-var">pLiftFst</span></a></span></span><span> </span><span id="local-6989586621680814358"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621680814358"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814357"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814357"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680814356"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814356"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621680814358"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814357"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814356"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span id="local-6989586621680814355"><span class="annot"><a href="GHC.Data.Pair.html#pLiftSnd"><span class="hs-identifier hs-type">pLiftSnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621680814355"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680814355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814355"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680814355"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-68"></span><span id="pLiftSnd"><span class="annot"><span class="annottext">pLiftSnd :: forall a. (a -&gt; a) -&gt; Pair a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#pLiftSnd"><span class="hs-identifier hs-var hs-var">pLiftSnd</span></a></span></span><span> </span><span id="local-6989586621680814354"><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621680814354"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-type">Pair</span></a></span><span> </span><span id="local-6989586621680814353"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814353"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680814352"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814352"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Pair a
forall a. a -&gt; a -&gt; Pair a
</span><a href="GHC.Data.Pair.html#Pair"><span class="hs-identifier hs-var">Pair</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814353"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; a
</span><a href="#local-6989586621680814354"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680814352"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-69"></span></pre></body></html>